<style lang="less">
    @import "approveTask.less";
</style>
<template>
    <div class="search">
        <Row>
            <Col>
                <Card>
                    <Row class="operation">
                        <Button v-has="'approve_agency_lock'" @click="setLock('yes')" type="primary" icon="md-lock">锁定</Button>
                        <Button v-has="'approve_agency_unlock'" @click="setLock('no')" type="primary" icon="md-unlock">解锁</Button>
                        <Button v-has="'approve_agency_label'" @click="addTags" type="primary" icon="md-settings">打标签</Button>
                        <circleLoading v-if="operationLoading"/>
                    </Row>
                    <Row>
                        <Form  ref="searchForm" :model="searchForm" inline :label-width="85" class="search-form" @keydown.enter.native="handleSearch">
                           <span v-if="drop">
                            <Form-item label="申请编号" prop="applyNo">
                                <Input type="text" v-model="searchForm.applyNo" clearable placeholder="请输入申请编号"
                                       style="width: 200px"/>
                            </Form-item>
                            <Form-item label="借款人姓名" prop="custName">
                                <Input type="text" v-model="searchForm.custName" clearable placeholder="请输入借款人姓名"
                                       style="width: 200px"/>
                            </Form-item>
                            <Form-item label="提交时间"  prop="passFirstDate">
                                <DatePicker v-model="selectDate" type="daterange" format="yyyy-MM-dd" clearable
                                            @on-change="selectDateRange" placeholder="选择起始时间"
                                            style="width: 200px"></DatePicker>
                            </Form-item>
                            <Form-item  label="标签"  prop="tag" >
                                <Select id="tagSelect"  v-model="searchForm.tag"
                                        :max-tag-count="3"
                                        :onscroll="true"
                                        multiple
                                         style="width:200px;" placeholder="请输入标签名称"  >
                                    <Option v-for="item in locationData" :value="item.id" :key="item.id"  >{{ item.labelName }}</Option>
                                </Select>

                            </Form-item>
                            <Form-item label="任务节点" prop="taskNodeName">
                                <Input type="text" v-model="searchForm.taskNodeName" clearable placeholder="请输入任务节点处"
                                       style="width: 200px"/>
                            </Form-item>

                            <Form-item label="流程类型" prop="processType">
                                <Select v-model="searchForm.processType" style="width:200px" clearable placeholder="请选择流程类型">
                                    <Option v-for="item in processTypeList" :value="item.value" :label="item.title" :key="item.value">{{ item.title }}</Option>
                                </Select>
                            </Form-item>
                            </span>
                            <Col :span="12" :offset="7">
                                <Form-item   v-if="dropDownContent=='展开'">
                                    <Button @click="handleSearch"  type="primary" icon="ios-search">查询</Button>
                                    <Button @click="handleReset"   type="primary" icon="ios-trash">清空</Button>
                                    <a class="drop-down" @click="dropDown">{{dropDownContent}}
                                        <Icon :type="dropDownIcon"></Icon>
                                    </a>
                                </Form-item>
                                <Form-item   v-if="dropDownContent=='收起'">
                                    <Button @click="handleSearch"  type="primary" icon="ios-search">查询</Button>
                                    <Button @click="handleReset"   type="primary" icon="ios-trash">清空</Button>
                                    <a class="drop-down" @click="dropDown">{{dropDownContent}}
                                        <Icon :type="dropDownIcon"></Icon>
                                    </a>
                                </Form-item>
                            </Col>
                        </Form>
                    </Row>
                    <Row>
                        <Alert show-icon>
                            已选择 <span class="select-count">{{selectCount}}</span> 项
                            <a class="select-clear" @click="clearSelectAll">清空</a>
                        </Alert>
                    </Row>
                    <Row>
                        <Table :auto-back-top="false" :loading="loading" border :columns="columns" :data="data" sortable="custom"
                               @on-sort-change="changeSort" @on-selection-change="showSelect" ref="table" :row-class-name="businessStatusIn_change">
                            <template slot-scope="{ row, index }" slot="action">
                                <Button v-has="'approve_agency_see_journal'" style="margin-right:5px"    type="primary" size="small" @click="showLogs(row)">查看日志
                                </Button>
                                <Button v-has="'approve_agency_reassignment'" type="error" size="small" @click="changeOwner(row)">改派</Button>
                            </template>
                            <template slot-scope="{ row, index }" slot="applyNo" >
                                <DynamicLink v-if="row.processType==='generaApprove'" component="projects/afs-core-business/pages/case/approve/task-detail/regular-approve/regularApproveDetail"
                                             :is-full="true"
                                             :params="{taskId:row.taskId,applyNo:row.applyNo,stageId:row.stageId,disposeCode:row.disposeCode,firstTrail:row.firstTrail,lastTrail:row.lastTrail,businessType:row.businessType,isCheck:'true',isAppear:true,processType:row.processType}"
                                             :name="row.applyNo" page-title="审批详情" ></DynamicLink>
                                <DynamicLink v-if="row.processType==='formalReview'" component="projects/afs-core-business/pages/case/approve/task-detail/regular-approve/regularApproveDetail"
                                             :is-full="true"
                                             :params="{taskId:row.taskId,applyNo:row.applyNo,stageId:row.stageId,disposeCode:row.disposeCode,firstTrail:row.firstTrail,lastTrail:row.lastTrail,businessType:row.businessType,isCheck:'true',isAppear:true,processType:row.processType}"
                                             :name="row.applyNo+'-正式复议'" page-title="正式复议" ></DynamicLink>
                                <DynamicLink v-if="row.processType==='changeAssets'" component="projects/afs-core-business/pages/case/approve/approve-fixed-asset/approvalAsset"
                                             :is-full="true"
                                             :params="{applyNo:row.applyNo,stageId:row.stageId,isCheck:'true',appear:'true',firstTrail:row.firstTrail,lastTrail:row.lastTrail,isAppear:true,processType:row.processType,disposeCode:row.disposeCode}"
                                             :name="row.applyNo+'-资产变更'" page-title="资产变更审批" ></DynamicLink>
                                <DynamicLink v-if="row.processType==='reconsiderApply'" component="projects/afs-core-business/pages/case/approve/reconside-ration/reconsideration"
                                             :is-full="true"
                                             :params="{businessStatusIn:row.businessStatusIn,applyNo:row.applyNo,stageId:row.stageId,isCheck:'true',firstTrail:row.firstTrail,lastTrail:row.lastTrail,isAppear:true,processType:row.processType,disposeCode:row.disposeCode}"
                                             :name="row.applyNo+'-复议申请'" page-title="复议申请审批"></DynamicLink>
                                <bubble :data="row.parseMessage" v-show="!loading && row.parseMessage" style="margin-top: -50px"/>
                            </template>
                            <template slot-scope="{ row, index }" slot="businessType">
                                <span>{{setBusinessTypeTitle(row.businessType)}}</span>
                            </template>
                            <template slot-scope="{ row, index }" slot="carType">
                                <span>{{setCarTypeTitle(row.carType)}}</span>
                            </template>
                            <template slot-scope="{ row, index }" slot="isLock">
                                <span>{{setIsLockTitle(row.isLock)}}</span>
                            </template>
                            <template slot-scope="{ row, index }" slot="processType">
                                <span>{{setProcessTypeTitle(row.processType)}}</span>
                            </template>
                            <template slot-scope="{ row, index }" slot="businessStatusIn">
                                <span>{{setBusinessStatusInTitle(row.businessStatusIn)}}</span>
                            </template>
                            <template slot-scope="{ row, index }" slot="loanAmt">
                                <span>{{row.loanAmt.toFixed(2)}}</span>
                            </template>
                            <template slot-scope="{ row, index }" slot="tags" >
                                <Tag v-for="item in row.labelList" :color="item.labelColor" >{{item.labelName}}</Tag>
                            </template>
                        </Table>
                    </Row>
                    <Row type="flex" justify="end" class="page">
                        <Page :current="searchForm.pageNumber" :total="total" :page-size="searchForm.pageSize"
                              @on-change="changePage" @on-page-size-change="changePageSize" :page-size-opts="[10,20,50]"
                              size="small" show-total show-elevator show-sizer></Page>
                    </Row>
                </Card>
            </Col>
        </Row>
        <Modal
            v-model="makeLabelVisible"
            :title="modalTitle"
            :closable="false"
            :width="550"
            :mask-closable="false"
            :footerHide="true"
            :draggable="true"
        >
            <makelabel v-show="makeLabelVisible" ref="selectLabel" :appno="applyno"   @cancel="cancel"></makelabel>
        </Modal>
        <approve-record v-model="recordVisible" ref="approveRecord" :applyNo="applyNoParam"  />
        <modal v-model="lockFormVisible"
               ref="lockOptionModel"
               :label-width="80"
               :title="modalTitle"
               :closable="false"
               :mask-closable='false'
               :width="600"
               :styles="{top: '180px'}">
            <div slot="footer">
                <Button type="text" @click="cancelLock">取消</Button>
                <Button type="primary"  @click="submitLock">提交</Button>
            </div>
            <Row>
                <Form ref="lockOptionForm" :model="lockOptionForm" inline :label-width="80" class="search-form" :rules="formValidate">
                    <Form-item label="备注" prop="processRemark">
                        <Input type="textarea" v-model="lockOptionForm.processRemark" clearable placeholder="请输入操作备注"
                               style="width: 450px;height: 50px;"/>
                    </Form-item>
                </Form>
            </Row>
        </modal>
        <task-handler :value="taskHandlerChangeVisible" @cancel="cancelTaskHandler" :task-ori-user-name="taskOriOwner"
                      :stage-id="stageId" :taskNodeIdProp="nodeId" @afterSubmit="afterChangeOwner"
        />
    </div>


</template>
<script>
    //代办任务组装查询
    import {
        queryApproveTaskList
    } from "@/projects/afs-core-business/api/afs-case/approve/approveTask";
    //数据字典
    import {
        getDictDataByType
    } from "_p/basic/api/admin/datadic";

    import circleLoading from "_c/circle-loading/circle-loading.vue";
    //引打标签vue
    import makelabel from "../make-label/makeLabel";
    //根据申请编号获取一打标签
    import {
        queryLabelByApplyNo
    } from "@/projects/afs-core-business/api/afs-case/make-label/makeLabel";
    //获取所有标签信息
    import {
        getAllLabelList
    } from "@/projects/afs-core-business/api/afs-case/manual-label/manualLabel";
    import approveRecord from "../approve-record/approve-record";
    //置顶、解锁
    import {
        modifyLock,
        modifyStick
    } from "@/projects/afs-core-business/api/afs-case/approve/taskpoolWait.js";
    import TaskHandler from "./task-handler";
    import Bubble from "../loan-approve-task/style/bubble";
    export default {
        name: "approve-task",
        components: {
            Bubble,
            TaskHandler,
            approveRecord,
            circleLoading,
            makelabel
        },
        data() {
            return {
                recordVisible: false,
                makeLabelVisible: false,
                modalTitle: "标签信息",
                loading: true,
                operationLoading: false,
                applyno: "",
                applyNoParam: '',
                locationData: [],
                selectDate: null,
                searchForm: {
                    applyNo: "",
                    passFirstDate: "",
                    submitDateStart: null,
                    submitDateEnd: null,
                    custName: "",
                    bondManName: "",
                    tag:[],
                    processType: "",
                    pageNumber: 1,
                    pageSize: 10,
                    pageNumberTag: 1,
                    pageSizeTag: 500

                },
                pageNumberTag: 1,
                pageSizeTag: 500,
                selectDate: null,
                selectList: [],
                selectCount: 0,
                modalType: 0,
                errorPass: "",
                carTypeList: [],
                businessTypeList: [],
                processTypeList: [],
                businessStatusIn: [],
                isLock: [],
                lockFormVisible: false,
                lockOptionStatus: '',
                secondsAgo: 0,
                interval: null,
                lockOptionForm: {
                    processRemark: ''
                },
                formValidate: {
                    processRemark: [{required: true, message: "备注不能为空", trigger: "blur"}]
                },
                columns: [
                    {
                        type: "selection",
                        minWidth: 60,
                        maxWidth: 60,
                        align: "center",
                        fixed: "left",
                        className: 'select-table-info-column'
                    },
                    {
                        title: "操作",
                        key: "action",
                        minWidth: 180,
                        align: "center",
                        fixed: "left",
                        slot: "action",
                        className: 'select-table-info-column'
                    },
                    {
                        title: "申请编号",
                        key: "applyNo",
                        minWidth: 200,
                        align: "center",
                        fixed: "left",
                        sortable: true,
                        slot: "applyNo"
                    },
                    {
                        title: "借款人姓名",
                        key: "custName",
                        minWidth: 120,
                        sortable: true
                    },
                    {
                        title: "标签",
                        key: "tags",
                        minWidth: 280,
                        sortable: true,
                        slot: "tags"
                    },
                    {
                        title: "计时时间",
                        key: "timming",
                        type: 'text',
                        sortable: true,
                        minWidth: 140
                    },
                    {
                        title: "业务状态（内）",
                        key: "businessStatusIn",
                        sortable: true,
                        minWidth: 150,
                        slot: "businessStatusIn"
                    },
                    {
                        title: "任务节点",
                        key: "taskNodeName",
                        align: "center",
                        sortable: true,
                        minWidth: 110,
                    },
                    {
                        title: "车辆",
                        key: "carName",
                        sortable: true,
                        minWidth: 110
                    }
                    ,
                    {
                        title: "首付比例",
                        key: "downPayScale",
                        sortable: true,
                        minWidth: 120
                    },
                    {
                        title: "贷款期限",
                        key: "loanTerms",
                        sortable: true,
                        minWidth: 110
                    },
                    {
                        title: "贷款金额",
                        key: "loanAmt",
                        sortable: true,
                        minWidth: 110
                    },
                    {
                        title: "合作商名称",
                        key: "dealerName",
                        sortable: true,
                        minWidth: 120
                    },
                    {
                        title: "锁定",
                        key: "isLock",
                        sortable: true,
                        type: 'singleSelect',
                        minWidth: 110,
                        slot: "isLock"
                    },
                    {
                        title: "提交时间",
                        key: "passFirstDate",
                        sortable: true,
                        minWidth: 160
                    },
                    {
                        title: "车辆类型",
                        key: "carType",
                        type: 'singleSelect',
                        sortable: true,
                        minWidth: 110,
                        slot: "carType"
                    },
                    {
                        title: "流程类型",
                        key: "processType",
                        type: 'singleSelect',
                        sortable: true,
                        minWidth: 110,
                        slot: "processType"
                    },
                    {
                        title: "业务类型",
                        key: "businessType",
                        type: 'singleSelect',
                        sortable: true,
                        minWidth: 110,
                        slot: "businessType"
                    }
                ],
                data: [],
                total: 0,
                totalTag: 0,
                taskHandlerChangeVisible: false,
                stageId: '',
                nodeId: '',
                taskOriOwner:'',
                dropDownContent: '展开',
                dropDownIcon: 'ios-arrow-down',
                drop: false
            };
        },
        methods: {
            init() {
                this.searchForm.pageNumber = 1;
                this.searchForm.pageSize = 10;
                this.getTaskList();
                this.queryLabelData();

            },
            businessStatusIn_change: function (e) {
                //
                // 暂停案件无底色
                if(e.businessStatusIn != "pause"&&e.processType!="changeAssets"&&e.processType!="reconsiderApply"&&e.processType!="formalReview") {
                    if (e.businessStatusIn === 'adviceConditional') {//建议附条件核准-绿色
                        return 'table-info-row-blue'
                    } else if (e.businessStatusIn === 'adviceApproved') {//建议核准案件-蓝色
                        return 'table-info-row-green'
                    } else if (e.businessStatusIn === 'adviceReject') {//建议核准案件-红色
                        return 'table-info-row-red'
                    } else if (e.businessStatusIn === 'reviseReply') {//建议核准案件-黄色
                        return 'table-info-row-yellow'
                    }
                    if (e.isHighlight === "yes" ) {
                        return 'table-info-row-purple'
                    }
                }
            },
            queryLabelData() {
                this.load= true;
                let params = "";
                params = {
                    pageNumberTag: this.pageNumberTag,
                    pageSizeTag: this.pageSizeTag,
                    label:'manual',
                    status:'takeEffect'
                };
                getAllLabelList(params).then(res => {
                    this.load = false;
                    if (res.code === "0000") {
                        this.locationData = res.data.records
                    }
                });
            },
            selectDateRange(v) {
                if (v) {
                    this.searchForm.submitDateStart = v[0];
                    this.searchForm.submitDateEnd = v[1];
                }
            },
            handleSearch() {
                this.searchForm.pageNumber = 1;
                this.searchForm.pageSize = 10;
                this.getTaskList();
            },
            handleReset() {
                this.$refs.searchForm.resetFields();
                this.searchForm.pageNumber = 1;
                this.searchForm.pageSize = 10;
                this.selectDate = null;
                this.searchForm.submitDateStart = "";
                this.searchForm.submitDateEnd = "";

                // 重新加载数据
                this.getTaskList();
            },
            //打标签 add by gjq
            addTags() {
                if (this.selectCount <= 0 || this.selectCount == undefined) {
                    this.$Message.warning("您还未选择数据");
                    return;
                }else if(this.selectCount > 1){
                    this.$Message.warning("请勾选单条数据操作");
                    return;
                }
                let apply="";
                let businessStatus="";
                this.selectList.forEach(function (e) {
                    apply=e.applyNo ;
                    businessStatus=e.businessStatusIn;

                });
                if(businessStatus==='repeal'
                    ||businessStatus==='approved'
                    ||businessStatus==='reject'
                    ||businessStatus==='conditionalApproval'
                    ||businessStatus==='cancelConditional'){
                    this.$Message.warning("该业务状态下不允许此操作！");
                    return;
                }
                this.applyno= apply;
                this.makeLabelVisible = true;
                queryLabelByApplyNo(this.applyno).then(res => {
                    if (res.code === "0000") {
                        this.$refs.selectLabel.getSelectLabel(res.data);
                    }
                });
            },
            hasSelected() {
                if (this.selectCount == 0) {
                    this.$Message.warning("需先勾选数据行!");
                    return false;
                } else {
                    return true;
                }
            },
            existsCurrentStatus(type, status) {
                let currentStatusNum = 0;
                this.selectList.forEach(record => {
                    if (type == "1") {
                        if (record.isLock == status) {
                            currentStatusNum++;
                        }
                    }
                });
                return currentStatusNum > 0;
            },
            //解锁
            setLock(status) {
                if (this.hasSelected()) {
                    if(this.existsCurrentStatus("1",status)){
                        this.$Message.warning("已选择数据存在"
                            +(status == "yes" ? "已锁定" : "非锁定")
                            +"数据，请去除勾选后再操作");
                    }else {
                        if (status == "yes") {
                            this.modalTitle = "锁定操作备注";
                        } else {
                            this.modalTitle = "解锁操作备注";
                        }
                        this.lockOptionStatus = status;
                        this.lockFormVisible = true;
                    }
                }
            },
            //备注提交
            submitLock() {
                let validResult = true;
                this.$refs.lockOptionForm.validate(valid =>{
                    if(!valid){
                        this.$Message.error("数据不合规，请检查数据项");
                        validResult = false;
                    }
                });
                if(validResult) {
                    this.operationLoading = true;
                    this.loading = true;
                    let data = [];
                    this.selectList.forEach(function (e) {
                        data += e.applyNo + ",";
                    });
                    modifyLock({
                        data: data,
                        lockRemark: this.lockOptionForm.processRemark,
                        status: this.lockOptionStatus
                    }).then(res => {
                        if (res.code == "0000") {
                            this.$Message.success("操作成功");
                            this.getTaskList();
                        }
                    });
                    this.loading = false;
                    this.cancelLock();
                    this.operationLoading = false;
                }
            },
            cancelLock(){
                this.lockFormVisible = false;
                this.lockOptionForm.processRemark = "";
            },
            //取消 add by gjq
            cancel(){
                this.makeLabelVisible = false;
                this.getTaskList();
            },
            clearSelectAll() {
                this.$refs.table.selectAll(false);
            },
            changeSort(e) {
                this.searchForm.sort = e.key;
                this.searchForm.order = e.order;
                if (e.order === "normal") {
                    this.searchForm.order = "";
                }
                this.getTaskList();
            },
            showSelect(e) {
                this.selectList = e;
                this.selectCount = e.length;
                // 仅在定时器数据刷新时选中框处理需要用到
                // 此处拿到的dataList是克隆数据，需改变源数据属性才有效
                this.data.forEach(tableData=>{
                    tableData._checked = false;
                    e.forEach( data => {
                        if(data.applyNo == tableData.applyNo){
                            tableData._checked = true;
                        }
                    })
                })
            },
            changePage(v) {
                this.searchForm.pageNumber = v;
                this.getTaskList();
                this.clearSelectAll();
            },
            changePageSize(v) {
                this.searchForm.pageSize = v;
                this.getTaskList();
            },
            showLogs(v) {
                this.applyNoParam = v.applyNo;
                this.recordVisible = true;
            },
            changeOwner(v) {
                // 改派
                this.stageId = v.stageId;
                this.nodeId = v.taskId;
                this.taskHandlerChangeVisible = true;
                this.taskOriOwner = v.disposeCode;
            },
            afterChangeOwner(row){
              this.taskHandlerChangeVisible = false;
              this.getTaskList();
            },
            seizeTask(){
                alert("抢单待开发")
            },
            getTaskList() {
                // 多条件搜索任务列表
                this.loading = true;
                let tag=this.searchForm.tag;
                if(tag!==""){
                    this.searchForm.tag= tag.join(',');
                }
                queryApproveTaskList(this.searchForm).then(res => {
                    this.loading = false;
                    if (res.code === "0000") {
                        this.data = res.data.records;
                        this.total = res.data.total;
                    }
                    this.searchForm.tag=tag;
                    if(this.total > 0) {
                        this.startAddSeconds();
                    }
                });
                this.selectCount=0;
            },
            dropDown() {
                if (this.drop) {
                    this.dropDownContent = '展开'
                    this.dropDownIcon = 'ios-arrow-down'
                } else {
                    this.dropDownContent = '收起'
                    this.dropDownIcon = 'ios-arrow-up'
                }
                this.drop = !this.drop
            },
            initProcessType(){
                let params = {
                    type: "processType"
                }
                getDictDataByType(params.type).then(res =>{
                    if (res.code === "0000"){
                        this.processTypeList = res.data;
                    }
                });
            },
            setProcessTypeTitle(val){
                let dic = {}
                this.processTypeList.forEach(column => {
                    if(column.value === val){
                        dic = column;
                    }
                });
                return dic.title;
            },
            initBusinessType(){
                let params = {
                    type: "confBusinessType"
                }
                getDictDataByType(params.type).then(res =>{
                    if (res.code === "0000"){
                        this.businessTypeList = res.data;
                    }
                });
            },
            setBusinessTypeTitle(val){
                let dic = {}
                this.businessTypeList.forEach(column => {
                    if(column.value === val){
                        dic = column;
                    }
                });
                return dic.title;
            },
            initCarType(){
                let params = {
                    type: "carType"
                };
                getDictDataByType(params.type).then(res =>{
                    if (res.code === "0000"){
                        this.carType = res.data;
                    }
                });
            },
            setCarTypeTitle(val){
                let dic = {}
                this.carType.forEach(column => {
                    if(column.value === val){
                        dic = column;
                    }
                });
                return dic.title;
            },
            initYesOrNoType(){
                let params = {
                    type: "isType"
                }
                getDictDataByType(params.type).then(res =>{
                    if (res.code === "0000"){
                        this.isLock = res.data;
                    }
                });
            },
            setIsLockTitle(val){
                let dic = {}
                this.isLock.forEach(column => {
                    if(column.value === val){
                        dic = column;
                    }
                });
                return dic.title;
            },
            initBusinessStatusInType(){
                let params = {
                    type: "businessStateIn"
                }
                getDictDataByType(params.type).then(res =>{
                    if (res.code === "0000"){
                        this.businessStatusIn = res.data;
                    }
                });
            },
            setBusinessStatusInTitle(val){
                let dic = {}
                this.businessStatusIn.forEach(column => {
                    if(column.value === val){
                        dic = column;
                    }
                });
                return dic.title;
            },
            startAddSeconds() {
                // 清除计时器
                if (this.interval) {
                    clearInterval(this.interval);
                }
                // 重置计时数据
                this.secondsAgo = 0;
                let _this = this;
                this.interval = setInterval(() => {
                    _this.secondsAgo++;
                }, 1000);
            },
            formatTimeUnit(seconds) {
                let hour = parseInt((seconds / 3600).toString());
                let minute = parseInt(((seconds % 3600) / 60).toString());
                let second = (seconds % 3600) % 60;
                return (hour < 10 ? "0" + hour : hour)
                    + " : " + (minute < 10 ? "0" + minute : minute)
                    + " : " + (second < 10 ? "0" + second : second);
            },
            cancelTaskHandler(){
                this.taskHandlerChangeVisible = false;
            },
        },
        created(){
            this.afs.afsOn(this,"flushData",()=>{
                this.getTaskList();
            })
        },
        beforeDestroy(){
            if (this.interval) {
                clearInterval(this.interval);
            }
            this.afs.afsOff(this,"flushData");
        },
        watch: {
            secondsAgo(newVal, oldVal) {
                this.data.forEach(data => {
                    if (!data.originalSeconds) {
                        data.originalSeconds = 0;
                    }
                    data.timming = this.formatTimeUnit(data.originalSeconds + newVal);
                });
            }
        },
        mounted() {
            this.init();
            this.initCarType();
            this.initProcessType();
            this.initBusinessType();
            this.initYesOrNoType();
            this.initBusinessStatusInType();
        }
    };
</script>
<style scoped>

</style>
